<%--
  Created by IntelliJ IDEA.
  customer: Administrator
  Date: 2020/9/11
  Time: 15:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>Sheraton酒店管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/public.css" media="all" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui_ext/dtree/dtree.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/layui_ext/dtree/font/dtreefont.css">
</head>
<body class="childrenBody">
<!-- 搜索条件开始 -->
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>查询条件</legend>
</fieldset>
<form class="layui-form" method="post" id="searchFrm">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户账号:</label>
            <div class="layui-input-inline" style="padding: 5px">
                <input type="text" name="loginId" autocomplete="off" class="layui-input layui-input-inline"
                       placeholder="请输入客户账号" style="height: 30px;border-radius: 10px">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户昵称:</label>
            <div class="layui-input-inline" style="padding: 5px">
                <input type="text" name="loginName" autocomplete="off" class="layui-input layui-input-inline"
                       placeholder="请输入客户昵称" style="height: 30px;border-radius: 10px">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">客户地址:</label>
            <div class="layui-input-inline" style="padding: 5px">
                <input type="text" name="address" autocomplete="off" class="layui-input layui-input-inline"
                       placeholder="请输入客户地址" style="height: 30px;border-radius: 10px">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">客户电话:</label>
            <div class="layui-input-inline" style="padding: 5px">
                <input type="text" name="phone" autocomplete="off" class="layui-input layui-input-inline"
                       placeholder="请输入客户电话" style="height: 30px;border-radius: 10px">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">性别:</label>
            <div class="layui-input-inline">
                <input type="radio" name="sex" id="available_on" value="1"  title="男">
                <input type="radio" name="sex" id="available_off" value="0" title="女">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-black" style="text-align: center">
            <button   class="layui-btn layui-btn-normal layui-icon layui-icon-search layui-btn-radius layui-btn-sm" lay-submit  lay-filter="doSearch">查询
            </button>
            <button type="reset" class="layui-btn layui-btn-warm layui-icon layui-icon-refresh layui-btn-radius layui-btn-sm">重置
            </button>
            <button type="button"
                    class="layui-btn layui-btn-green layui-icon layui-icon-download-circle layui-btn-radius layui-btn-sm"
                    id="doExport" style="margin-top: 4px">导出
            </button>
        </div>
    </div>
</form>


<!-- 搜索条件结束 -->
<table id="customerTable" lay-filter="customerTable"></table>

<%--<script id="toolbarcustomer" type="text/html">--%>
    <%--<div class="layui-btn-container">--%>
        <%--<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="customerAdd">添加</button>--%>
        <%--<button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="delBatch">批量删除</button>--%>
    <%--</div>--%>
<%--</script>--%>

<%--<script id="barcustomer" type="text/html">--%>
    <%--<a class="layui-btn layui-btn-xs layui-btn-radius" lay-event="edit">编辑</a>--%>
    <%--<a class="layui-btn layui-btn-danger layui-btn-xs layui-btn-radius" lay-event="del">删除</a>--%>
<%--</script>--%>


<%-- 添加或者修改弹出框结束 --%>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/layui/layui.js"></script>
<%--<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/index.js"></script>--%>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/cache.js"></script>
<script>
    var tab;
    layui.use(
        ['table', 'layer', 'form', 'jquery'], function () {
            var table = layui.table;
            var form = layui.form;
            var $ = layui.jquery;
            var layer = layui.layer;
            // var dtree = layui.dtree;


            tab = table.render({
                elem: '#customerTable',
                url: "${pageContext.request.contextPath}/customer/customerShow",
                cellMinWidth: 30,
                page: {limit: 5, limits: [5, 10, 15, 20]},
                // toolbar: '#toolbarcustomer',//开启头部工具栏，并为其绑定左侧模板
                cols: [[
                    // {type: 'checkbox', fixed: 'left'},
                    {field: 'userId', width: 150, title: '用户ID', sort: true}
                    ,{field: 'loginId', width:150, title: '用户账号', sort: true}
                    , {field: 'loginName', width: 150, title: '用户昵称'}
                    , {field: 'sex', width: 80, title: '性别', sort: true,templet: function (data) {
                            return data.sex == 1 ? '男' : '女'
                        }}

                    ,{field: 'address', width: 250, title: '地址', sort: true}
                    ,{field: 'phone', width: 300, title: '电话号码', sort: true,fixed:'right'}
                    // ,{field: 'createtime', width: 80, title: '职位', sort: true,fixed:'right'}
                    // , {fixed: 'right', title: '操作', toolbar: '#barcustomer', width: 120}
                ]]
            })

            form.on('submit(doSearch)', function (data) {
                //ajax数据
                tab.reload({
                    where: data.field
                })
                //不跳转页面
                return false;
            })

            $("#doExport").click(function () {
                location.href = "${pageContext.request.contextPath}/customer/customerExport?"+$("#searchFrm").serialize()
            })
        })

</script>
</body>
</html>


